package thread;

public class ThreadDemo extends Thread{
	public void run() {
		for(int i =1;i<21;i++){
			System.out.println(this.getName()+":"+i);
		}
		System.out.println(this.getName()+"的优先级为"+this.getPriority());
	}
	public ThreadDemo(String name){
		super(name);
	}
	public static void main(String[] args) {
		ThreadDemo td = new ThreadDemo("11#");
		td.setPriority(MAX_PRIORITY);
		td.start();
		for(int j=1;j<10;j++){
			//new ThreadDemo(j+"#").start();
			new ThreadDemo(j+"#").run();
		}
	}
}
